package project.layer.physical;

import java.util.Iterator;

import project.layer.agents.PackagePointAgent;
import framework.layer.agent.Agent;
import framework.layer.physical.entities.StaticResource;


public abstract class PackagePoint extends StaticResource<Crossroad>{
	private Package pdpPackage;
	
	
	

	
	public PackagePoint(){
		
	}

	public void setPdpPackage(Package pdpPackage) {
		this.pdpPackage = pdpPackage;
	}

	public Package getPdpPackage() {
		return pdpPackage;
	}
	
	public boolean hasPackage(){
		return getPdpPackage() != null;
	}
	public PackagePointAgent getCorrespondingAgent(){
		if(hasAttachedDevices()){
			Iterator<Agent> it = getAgentsOnAttachDevices().iterator();
			return (PackagePointAgent) it.next();
		}
		return null;
	}
}
